package com.catchu.pattern.creational.构造器模式.bill;

/**
 * 账单管理器
 */
public class BillManage {

    /**
     * 根据订单输出账单
     * @param order
     */
    public void outputBill(Order order){
        IBillBuilder billBuilder = null;
        if(order.getOrderType()==0){
            //国内订单
            billBuilder = new DemosticBillBuilder();
        }
        BillDirector billDirector = new BillDirector(billBuilder);
        billDirector.concreteBill(order);
        Object bill = billBuilder.getBill();
        if(order.getOrderType()==0){
            System.out.print(((DemosticBill) bill).toString());
        }

    }
}
